package ctrutil

import (
	"time"
	"github.com/astaxie/beego/logs"
	"cloud_worm/util/third/unotify"
)

type LocalTestChannel struct {
	Duration 		time.Duration
	MaxSendSize 	int
}

func (l *LocalTestChannel) SetConfig()  {
	l.Duration = 10 * time.Second
	l.MaxSendSize = 60

	return
}

func (l *LocalTestChannel) GetDuration() time.Duration {
	return l.Duration
}

func (l *LocalTestChannel) GetMaxSendSize() int {
	return l.MaxSendSize
}

func (l *LocalTestChannel) Send(msg string, targetType int, toUsers []string) error {
	logs.Notice(msg)
	return nil
}

func init()  {
	testChannel := new(LocalTestChannel)
	unotify.IMNotifyInst.SetChannel(testChannel)
}